<a href="" 执行 Javascript 函数问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 15:46:21
这个问题有点怪异,我要的效果是这样的格式:
<a href="x.asp?tp="javascript:document.documentElement.scrollTop"">a</a>
我要当点击这个连接的时候返回当前滚动条高度。
例如当前滚动条高度为 111
那么,你点击这个链接其实连接到 x.asp?tp=111,有没办法实现这个?环境原因,一定要这个设置!谢谢!

<a href="#" onclick="return aaa();">a</a>
<script type="text/javascript">
function aaa()
{
location.href="x.asp?tp="+document.documentElement.scrollTop;
return false;
}
</script>

<a href="#" onclick="return aaa();">a</a>
<script type="text/javascript">
function aaa()
{
location.href="x.asp?tp="+document.documentElement.scrollTop;
return false;
}
</script>
那个4级和6级的很邪恶 明显一个抄另一个的 呵呵 直接给我分得了 哇咔咔
当然我也是抄他们的。

<script type="text/javascript">
function gh(obj)
{
obj.href += document.documentElement.scrollTop;
return true;
}
</script>
<a href="x.asp?tp=" onclick="gh(this)">a</a>

你说的这个问题,这上面就有很详细的解决方案哦,他们的java教程很全面,你可以去了解下
参考资料:<a href=" ----- 怎样改成双击进行链接? <a href="Untitled-3.htm <a href="?">自身</a> 和 <a href="#">自身</a> 有什么区别? <a href=" ? &noedit=1" </a>中的问号是什么意思 <a href="#">***</a>的问题 <a href=''></a>问题 <a href>跳转用法 jsp中<a href>问题 <a href="../news/more.asp?type=a <a href="action.asp"?><%=rs(1).value%></a>